<?php
/**
 * 周舟 hzboye010@163.com
 * addby sublime snippets
 */
namespace app\shop\api;

use app\common\api\BaseApi;
use app\shop\model\ProductService;
// use app\extend\Page;

class ProductServiceApi extends BaseApi{

		const ADD              = "shop/ProductServiceApi/add";
		const DELETE           = "shop/ProductServiceApi/delete";
		const SAVE             = "shop/ProductServiceApi/save";
		const SAVE_BY_ID       = "shop/ProductServiceApi/saveByID";
		const COUNT            = "shop/ProductServiceApi/count";
		const GET_INFO         = "shop/ProductServiceApi/getInfo";
		const QUERY            = "shop/ProductServiceApi/query";
		const QUERY_NO_PAGING  = "shop/ProductServiceApi/queryNoPaging";
		const QUERY_WITH_COUNT = "shop/ProductServiceApi/queryWithCount";
		const QUERY_WITH_NAME  = "shop/ProductServiceApi/queryWithName";

    protected function _init(){
        $this -> model = new ProductService();
    }

    public function queryWithName($map = null,$order = false,$field = false){
    	$this->model->where($map)
    	->join('(select id as service_id,name as service_name from common_datatree ) s on dt_service_id=s.service_id')
    	->order($order)->field($field);
    }
}